/* $Id: UtilityDelegateImpl.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.delegate.provider;

import java.io.Serializable;
import java.util.List;

import ae.pcfc.etks.online.common.delegate.UtilityDelegate;
import ae.pcfc.etks.online.common.facade.UtilityFacade;
import ae.pcfc.etks.online.common.vo.CityVO;
import ae.pcfc.etks.online.common.vo.ClientRoleVO;
import ae.pcfc.etks.online.common.vo.CountryVO;
import ae.pcfc.etks.online.common.vo.DepartmentVO;
import ae.pcfc.etks.online.common.vo.EmirateCityVO;
import ae.pcfc.etks.online.common.vo.EmirateVO;
import ae.pcfc.etks.online.common.vo.LicIssueAuthVO;
import ae.pcfc.etks.online.common.vo.LicTypeVO;
import ae.pcfc.etks.online.common.vo.NameTitleVO;
import ae.pcfc.etks.online.common.vo.VisaTypeVO;

public class UtilityDelegateImpl extends BaseDelegateImpl implements UtilityDelegate {
    	/*
	 * Here we coordinate between the Facade service which handles DB entities
	 * and the WF both will be looked up with service locator normally we will
	 * have 1-1 relationship between the delegate and the facade and 1-1
	 * relationship between the delegate and the WF service which means for
	 * CompanyRegistrationDelegate there will be ClientRegistrationFacade &
	 * CompanyRegistrationWF validations that related to DB vs WF are maintained
	 * here ie user cannot issue a new request while he already have a request
	 * in the wf Exception are translated in to business exception
	 */
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4852126940389126635L;

	/**
	 * getClientRoleList
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getClientRoleList(java.lang.String, boolean)
	 * 
	 */
	public List<ClientRoleVO> getClientRoleList(String clientCategory, boolean bHideDefault) {
		return serviceLocator.getFacadeService(UtilityFacade.class).getClientRoleList(clientCategory, bHideDefault);
	}

	/**
	 * getCountryList
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getCountryList(java.lang.String)
	 * 
	 */
	public List<CountryVO> getCountryList(String locale) {
		return serviceLocator.getFacadeService(UtilityFacade.class).getCountryList(locale);
	}
	
	/**
	 * getLicIssuingAuth
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getLicIssuingAuth()
	 * 
	 */
	public List<LicIssueAuthVO> getLicIssuingAuth(){
		return serviceLocator.getFacadeService(UtilityFacade.class).getLicIssuingAuth();
	}
	
	/**
	 * getLicType
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getLicType()
	 * 
	 */
	public List<LicTypeVO> getLicType(){
		return serviceLocator.getFacadeService(UtilityFacade.class).getLicType();
	}
	
	/**
	 * getNameTitle
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getNameTitle()
	 * 
	 */
	public List<NameTitleVO> getNameTitle(){
		return serviceLocator.getFacadeService(UtilityFacade.class).getNameTitle();
	}
	
	/**
	 * getVisaType
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getVisaType()
	 * 
	 */
	public List<VisaTypeVO> getVisaType(){
		return serviceLocator.getFacadeService(UtilityFacade.class).getVisaType();
	}
	
	/**
	 * getCityListByCountryCode
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getCityListByCountryCode(java.lang.String, java.lang.String)
	 * 
	 */
	public List<CityVO> getCityListByCountryCode(String countryCode, String locale) {
		return serviceLocator.getFacadeService(UtilityFacade.class).getCityListByCountryCode(countryCode, locale);
	}	
	
	/**
	 * getDepartments
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getDepartments()
	 * 
	 */
	public List<DepartmentVO> getDepartments(){
		return serviceLocator.getFacadeService(UtilityFacade.class).getDepartments();	
	}

	/**
	 * getUserSecurityRole
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getUserSecurityRole(java.lang.String)
	 * 
	 */
	public List<String> getUserSecurityRole(String userName) {
		
		return serviceLocator.getFacadeService(UtilityFacade.class).getUserSecurityRole(userName);
	}

	/**
	 * getAllLicIssuingAuth
	 * 
	 * @see ae.pcfc.etks.online.common.delegate.UtilityDelegate#getAllLicIssuingAuth()
	 * 
	 */
	public List<LicIssueAuthVO> getAllLicIssuingAuth() {
	    return serviceLocator.getFacadeService(UtilityFacade.class).getAllLicIssuingAuth();
	}

	public List<EmirateVO> getEmirates(String locale) {
		return serviceLocator.getFacadeService(UtilityFacade.class).getEmirates(locale);
	}

	public List<EmirateCityVO> getEmirateCityByEmirateCode(String emirateCode,
			String locale) {
		return serviceLocator.getFacadeService(UtilityFacade.class).getEmirateCityByEmirateCode(emirateCode, locale);
	}

}
